//
//  ViewController.m
//  10502homework
//
//  Created by student on 16/2/19.
//  Copyright © 2016年 NIIT. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


- (IBAction)shengcheng:(id)sender {
    NSString *str = self.mubanTV.text;
    NSMutableString *mstr = [str mutableCopy];
    NSRange range1 = [mstr rangeOfString:@"<name>"];
    while (range1.location != NSNotFound)
    {
        [mstr replaceCharactersInRange:range1 withString:self.nameText.text];
        range1 = [mstr rangeOfString:@"<name>"];
    }
    NSRange range2 = [mstr rangeOfString:@"<age>"];
    while (range2.location != NSNotFound) {
        [mstr replaceCharactersInRange:range2 withString:self.nameText.text];
        range2 = [mstr rangeOfString:@"<age>"];
    }
    NSRange range3 = [mstr rangeOfString:@"<class>"];
    while (range3.location != NSNotFound) {
        [mstr replaceCharactersInRange:range3 withString:self.nameText.text];
        range3 = [mstr rangeOfString:@"<class>"];
    }
    self.shengchengTV.text = mstr;
}
- (IBAction)tabel:(id)sender {
    [self.view endEditing:YES];
}

@end
